<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .process{
            border: 1px solid #ddd;
            height: 20px;
            width: 300px;
            border-radius: 10px;
            margin: 100px  auto;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(87, 87, 87, 0.2);
        }
        .process div{
            background: rgb(0, 194, 0);
            height: 20px;
            width: 0;
            
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="process">
            <div v-bind:style="{width:process + '%'}"></div>
        </div>

        <!-- <button v-on:click="processEvent">点击</button> -->
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
    <script>
       var vue = new Vue ({
            el:"#app",
            data:{
                process:0,
                isShow:false
            },
            mounted:function(){
                this.processEvent();
            },
            methods:{
                processEvent:function(){
                    let that = this;
                    // this.process = this.process + 10;
                    // console.log(p);
                    let timer = setInterval(function(){
                        that.process += 1;
                        if(that.process > 100){
                            clearInterval(timer);
                            alert('hello word');
                        }
                        console.log(that.process);
                    },100);
                    
                }
            }
        })
    </script>
</body>
</html>